import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
const path = require('path');
// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue()],
  server: {
    // 自动在浏览器打开
    open: true,
    // 端口号
    port: 8896,
    // 反向代理配置
    proxy: {
      '/api': {
        target: 'http://localhost:8897',
        changeOrigin: true,
        rewrite: path => path.replace(/^\/api/, '')
      }
    }
  },
  resolve: {
    alias:{
      '@': path.resolve(__dirname, 'src')
    }
  }
})
